package com.lizard.schedule.ui.adapter.schedule;

import com.lizard.schedule.persistence.db.bean.Schedule;
import com.lizard.schedule.utils.TimeUtil;

/**
 * schedule bean的门面，提供一些预计算好的数据给ScheduleListAdapter使用
 */
public class ScheduleFacade {

    private Schedule mSchedule;

    /**
     * 日期字符串
     */
    private String mDateStr;

    /**
     * 时间字符串
     */
    private String mTimeStr;

    /**
     * 周字符串
     */
    private String mDayOfWeekName;

    /**
     * "今天"、"明天"、"后天"、"昨天"、"前天"、""
     */
    private String mDayNearby;

    /**
     * "今"、"明"、"后"、"昨"、"前"、""
     */
    private String mBrefDayNearby;

    public ScheduleFacade(Schedule schedule){
        mSchedule = schedule;
        mDateStr = TimeUtil.transferToDate(schedule.getBeginTime());
        mTimeStr = TimeUtil.transferToTime(schedule.getBeginTime());
        mDayOfWeekName = TimeUtil.transferToWeekDayName(schedule.getBeginTime());
        long currentTimeMills = System.currentTimeMillis();
        mDayNearby = TimeUtil.getDayNearby(currentTimeMills, schedule.getBeginTime());
        mBrefDayNearby = TimeUtil.getBrefDayNearby(currentTimeMills, schedule.getBeginTime());
    }

    public Schedule getSchedule(){
        return mSchedule;
    }

    /**
     * 获取 "今天"、"明天"、"后天"、"昨天"、"前天"、""
     *
     * @return
     */
    public String getDayNearby(){
        return mDayNearby;
    }

    /**
     * 获取 "今"、"明"、"后"、"昨"、"前"、""
     *
     * @return
     */
    public String getBrefDayNearby(){
        return mBrefDayNearby;
    }

    /**
     * 获取日期字符串 如：1989-6-8
     *
     * @return
     */
    public String getDateStr(){
        return mDateStr;
    }

    /**
     * 获取时间字符串 如：18:30
     *
     * @return
     */
    public String getTimeStr(){
        return mTimeStr;
    }

    /**
     * 获取周字符串 如：周一
     *
     * @return
     */
    public String getDayOfWeekName(){
        return mDayOfWeekName;
    }

}
